LEGION Simulator API Readme

Querying Licence Information

To query licence information, create a connection string and use Licence Support functions:
// Get some licence information
Legion::LicenceSupport::Simulator_API_ConnectionString::SimAPIPublicKeyPtr	pPublicLicenceKey_Out;
Legion::LicenceSupport::CLegnLicenceSupport 				licenceSupport( pPublicLicenceKey_Out );
std::string 							strLicenceConnectionString_Out;
Legion::LicenceSupport::Simulator_API_ConnectionString::Encrypt(
pPublicLicenceKey_Out, sLicenseeOrganisation_In, sProductName_In, sProductVersion_In, strLicenceConnectionString_Out );

std::string organisation;
licenceSupport.GetLicenseeOrganisation( strLicenceConnectionString_Out, organisation );
std::cout << "Licensee Organisation: " << organisation << std::endl;

std::string sExpiryDate; 
licenceSupport.GetExpiryDate( strLicenceConnectionString_Out, sExpiryDate );
std::cout << "Expiry date:   " << sExpiryDate << std::endl;

int iMaxActivityObjects = licenceSupport.GetMaxActivityObjects( strLicenceConnectionString_Out );
std::cout << "Max activity objects: " << iMaxActivityObjects << std::endl;

bool bCanRecordRES = licenceSupport.CanRecordRES( strLicenceConnectionString_Out );
std::string boolalpha = ( bCanRecordRES ? "yes" : "no" );
std::cout << "Can record RES: " << boolalpha << std::endl;
Note: Some Licence Support functions require the user to be signed-in to CONNECTION Client to succeed, and may throw an exception if not signed-in. For instance, calling licenceSupport.GetLicenseeOrganisation if not signed in throws a Legion::Exception::LicenceException
Note: Always generate a new public key and connection string for license-query functions. Failure to do so will result in an RSA exception: InvertibleRSAFunction: computational error during private key operation